package edu.ptu.communityplatform.common.controller;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @BelongsProject: communityPlatform
 * @BelongsPackage: edu.ptu.communityplatform.common.controller
 * @Author: HYJ
 * @CreateTime: 2025-04-05  02:50
 * @Description: TODO
 * @Version: 1.0
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SimpleResponse {
    /**
     * 响应状态码
     */
    private Integer code;
    /**
     * 响应信息
     */
    private String msg;

    /**
     * 成功响应
     *
     * @return SimpleResponse 成功响应对象
     */
    public static SimpleResponse success() {
        return new SimpleResponse(200, "success");
    }

    /**
     * 失败响应
     *
     * @return SimpleResponse 失败响应对象
     */
    public static SimpleResponse fail() {
        return new SimpleResponse(500, "fail");
    }
}
